package model;

/**
 * Dice Control
 * 
 * Class for the Dice
 * create the Dice and roll them
 * take care if dice are two of a kind
 * @author wsiebert
 */
public class Dice {
	private int first_die;
	private int second_die;
	private boolean is_twoOfAkind;
	

	public Dice()
	{
		first_die = 0;
		second_die = 0;
		is_twoOfAkind = false;	
	}
	
	/**
	 * Method to roll the Dice and check TOAK 
	 */
	public void rollDice()
	{
		first_die = (int)(Math.random()*6 + 1);
		second_die= (int)(Math.random()*6 + 1);
		
		if(first_die == second_die) 
		{
			is_twoOfAkind = true;
		}
		else
		{ 
			is_twoOfAkind = false;
		}
	}
	
	/**
	 * Method to get true if there is two of a kind
	 * @return diceValues true if there is two of a kind
	 */
	public boolean get_is_twoOfAkind()
	{
		return is_twoOfAkind;
	}
	
	public int[] get_Die_Values()
	{
		int[] diceValues ={first_die, second_die};
		return diceValues;
	}
}


